package org.pearl.thread.demo.test001;

import java.util.concurrent.Executor;

/**
 * Created by TD on 2021/4/12
 */
public class ExecutorTest001 {
    public static void main(String[] args) {
        Executor executor = new MyExecutor();
        MyRunnable003 myRunnable003 = new MyRunnable003();
        Thread thread=new Thread(myRunnable003);
        executor.execute(thread);
    }
}

class MyExecutor implements Executor {
    @Override
    public void execute(Runnable command) {
        command.run();
    }
}

class MyRunnable003 implements Runnable {
    @Override
    public void run() {
        for (int i = 100; i > 0; i--) {
            System.out.println(Thread.currentThread().getName() + "线程正在运行任务");
        }
    }
}

